<?php
/*
 * File: logout.php
 * Created: 18 июня 2007
 * Author: Andrew Dashin <dash@andrewdashin.com>
 * 
 * Description:
 * 
 * This is logout service
 * 
 * Return values:
 * 
 * 0 Successfully logged out
 * 1 User is not logged in
 * 
 */
 
if (isset($_SESSION['userid'])) {
    // Unset all session data;
    // Look to the best way how it could be performed
    session_unset();
    echo '0'; // Successfully logged out
} else {
	echo '1'; // User is not logged in
}
?>
